//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by Fernflower decompiler)
//

package com.vere.orm.util;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;

public class CHttpUtil {
    public CHttpUtil() {
    }

    public static String license(String path, String charset) {
        boolean isException = false;
        InputStream in = null;
        StringBuilder sb = new StringBuilder();
        HttpURLConnection conn = null;

        try {
            URL uri = new URL(path);
            conn = (HttpURLConnection)uri.openConnection();
            conn.setReadTimeout(20000);
            conn.setDoInput(true);
            conn.setDoOutput(true);
            conn.setUseCaches(false);
            conn.setRequestMethod("GET");
            conn.connect();
            in = conn.getInputStream();
            BufferedReader br = new BufferedReader(new InputStreamReader(in, charset));
            String str = null;

            while((str = br.readLine()) != null) {
                sb.append(str);
            }
        } catch (Exception var17) {
            var17.printStackTrace();
            isException = true;
        } finally {
            try {
                if (in != null) {
                    in.close();
                }

                if (conn != null) {
                    conn.disconnect();
                }
            } catch (IOException var16) {
                var16.printStackTrace();
            }

        }

        return sb.toString();
    }
}
